#howto
#zoom C-a + z
#reshape: C-a + C-direction
#change panle: C-a + space, C-a + C-O

#prefix
set-option -g prefix C-a
unbind-key C-a
bind-key C-a send-prefix

# set Zsh as your default Tmux shell
set-option -g default-shell /bin/zsh
# UTF is great, let us use that
set -g utf8
set-window-option -g utf8 on
# Tmux should be pretty, we need 256 color for that
set -g default-terminal "screen-256color"

bind-key r source-file ~/.tmux.conf \; display-message "~/.tmux.conf is reloaded"

set-option -g history-limit 10000

set -g base-index 1
set -g renumber-windows off

#mouse mode
#set -g mode-mouse on
#set -g mouse-resize-pane on
#set -g mouse-select-pane on
#set -g mouse-select-window on

#pane split
bind-key | split-window -h
bind-key - split-window -v

#bind pane select
bind-key k select-pane -U #up (prefix k)
bind-key j select-pane -D #down
bind-key h select-pane -L #left
bind-key l select-pane -R #right

# resize pane
bind -r ^k resizep -U 1 # upward (prefix Ctrl+k)
bind -r ^j resizep -D 1 # downward (prefix Ctrl+j)
bind -r ^h resizep -L 1 # to the left (prefix Ctrl+h)
bind -r ^l resizep -R 1 # to the right (prefix Ctrl+l)

set-option -g mode-keys vi
bind-key -t vi-copy "v" begin-selection
bind-key -t vi-copy "y" copy-selection
bind-key -t vi-copy "V" rectangle-toggle
bind-key b list-buffers

#status bar
set -g status-keys vi
set -g window-status-current-fg white
set -g window-status-current-bg black
set -g window-status-current-attr dim
set -g status-left-length  30
set -g status-right-length 100

set -g status-right ' #{prefix_highlight} #H SanJose #(TZ="America/Los_Angeles" date +%%Y-%%m-%%d) #(TZ="America/Los_Angeles" date +%%a@%%H:%%M) '



https://stackoverflow.com/questions/5311583/tmux-how-to-make-new-window-stay-when-start-shell-command-quits/5312607
I use send-keys so that it "types" the command into the shell. Here's my get.all script, which fires up many commands, some of which I may need to interact with after they're done (and the ones I don't, have exit):

You can use C-m instead of Enter
#!/bin/sh
tmux att -t get ||
tmux \
  new -s get -n emacs \; \
  send-keys 'get.emacs' C-m \; \
  neww -n git \; \
  send-keys 'get.git' C-m \; \
  neww -n mini \; \
  send-keys 'get.mini' C-m \; \
  neww -n port \; \
  send-keys 'get.port' C-m \; \
  neww -n rakudo \; \
  send-keys 'get.rakudo' C-m \; \
  neww -n neil \; \
  send-keys 'get.neil && get.neil2 && exit' C-m \; \
  neww -n red \; \
  send-keys 'get.red && exit' C-m \; \
  neww -n cpan \; \
  send-keys 'get.cpan && exit' C-m \; \
  selectw -t emacs



tmux att -t regr0813 ||
tmux new -s regr0813 -n main \; \
neww -n id1 \; \
send-keys 'make 1' C-m \; \
split-window \; \
neww -n id2 \; \
send-keys 'make 2' C-m \; \
split-window \; \
neww -n id3 \; \
send-keys 'make 3' C-m \; \
split-window \; \
neww -n id4 \; \
send-keys 'make 4' C-m \; \
split-window \; \
neww -n id5 \; \
send-keys 'make 5' C-m \; \
split-window \; \
neww -n id7 \; \
send-keys 'make 7' C-m \; \
split-window \; \
selectw -t main

